<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace addons\config\user\controller;

/**
 * Description of Log
 * 管理日志
 * @author shilinqing
 */
class Log extends \web\user\controller\AddonUserBase{
    
    public function index(){
        return $this->fetch();
        
    }
    
    public function loadList() {
        $keyword = $this->_get('keyword');
        $filter = '1=1';
        $m = new \addons\config\model\Log();
        if ($keyword != null) {
            $filter .= ' and action_name like \'%' . $keyword . '%\'';
        }
        $total = $m->getTotal($filter);
        $rows = $m->getDataList($this->getPageIndex(), $this->getPageSize(), $filter);
        return $this->toDataGrid($total, $rows);
    }
    
    public function edit(){
        $id = $this->_get('id');
        $m = new \addons\config\model\Log();
        $data = $m->getDetail($id, 'data');
        $this->assign('id',$id);
        $this->assign('data',$data);
        return $this->fetch();
    }
    
}
